package com.wuzuqing.android.eightdiagrams

import android.os.Bundle
import android.webkit.WebView
import android.webkit.WebViewClient

class TestActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContentView(R.layout.activity_test)
        findViewById<WebView>(R.id.webview)?.also {mWebView->

            mWebView.setBackgroundColor(0); // 设置背景色
            mWebView.getBackground().setAlpha(0); // 设置填充透明度 范围：0-255
            val url = "https://m.2tianxin.com/beta/resources/resourceConsortia/20250611182657/index.html?userid=2010738&roomid=123456&SudMGP_APP_ID=1932406622939676672&SudMGP_APP_KEY=9jEWjAWRs8vvmAO7EWiSVrpSe4io5TUZ&t=4545d6465#/game/1739914495960793090"

            mWebView.getSettings().setJavaScriptEnabled(true);

            mWebView.setWebViewClient(object : WebViewClient() {
                override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
                    view.loadUrl(url!!)
                    return true
                }
            })
            mWebView.loadUrl(url)
        }
    }
}